<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title></title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="${base}/template/assets/i/favicon.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="${base}/template/assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">

  <link rel="stylesheet" href="${base}/template/assets/css/amazeui.min.css">
  <link rel="stylesheet" href="${base}/template/assets/css/app.css">
  <link rel="stylesheet" href="${base}/template/assets/css/admin.css">
  <script src="${base}/template/assets/js/jquery.min.js"></script>
  <%
	var isAdd = false;
	var isEdit = false;
	if(isEmpty(admin.id)){
		isAdd = true;
	}else{
		isEdit = true;
  }%>
</head>
<body>
<!--在这里编写你的代码-->
<div class="admin-content">
  <div class="am-cf am-padding">
    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">管理员</strong> / <small>管理员列表</small></div>
  </div>
 <hr style="am-padding-bottom:2px;margin:0px;"/>
 <form id="inputForm" class="am-form" action="<%if (isAdd){%>${base}/admin/save<%}else{%>${base}/admin/update<%}%>" method="post">
  <div class="am-tabs am-margin" data-am-tabs style="padding-top:5px;margin:0px;">
	    <ul class="am-tabs-nav am-nav am-nav-tabs">
	      <li class="am-active"><a href="#tab1">基本信息</a></li>
	      <li><a href="#tab2">个人资料</a></li>
	    </ul>
    <div class="am-tabs-bd">
      <div class="am-tab-panel am-fade am-in am-active" id="tab1">
        <input type="hidden" name="admin.id" value="${admin.id!}" />
          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right">用户名</div>
            <div class="am-u-sm-8 am-u-md-4">
	            <%if (isAdd){%>
					<input type="text" name="admin.username" class="am-input-sm" value="${brand.name!}" required/>
				<%}else{%>
					${admin.username!}
					<input type="hidden" name="admin.username" value="${admin.username!}" />
				<%}%>
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${usernameMessages!}</div>
          </div>

          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right">密 码</div>
            <div class="am-u-sm-8 am-u-md-4">
              <input type="password" name="admin.password" id="password"/>
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${passwordMessages!}</div>
          </div>

          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right">重复密码</div>
            <div class="am-u-sm-8 am-u-md-4">
              <input type="password" name="rePassword" class="am-input-sm" />
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${rePasswordMessages!}</div>
          </div>

          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right">E-mail</div>
            <div class="am-u-sm-8 am-u-md-4">
              <input type="text" name="admin.email" class="am-input-sm" value="${admin.email!}" required/>
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${emailMessages!}</div>
          </div>

          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right">管理角色</div>
            <div class="am-u-sm-8 am-u-md-4">
            <div class="am-g">
              <%for(list in allRole!){%>
					<div class="am-u-sm-4"><label class="am-checkbox"><input type="checkbox" name="roleList.id" class="am-input-sm" value="${list.id!}"  data-am-ucheck
						<% if(isEdit){
							var roleList = admin.roleList;
							for(var i = 0; i < roleList.~size; i++){
								if (strutil.contain(roleList[i].value,list.value)){%> checked="checked"<%}
							}
						}%>
						/>
						${list.name!}
					</label></div>
				<%}%>
				<div class="am-u-sm-6"></div>
				</div>
				<span id="roleMessagePosition"></span>
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">&nbsp;</div>
          </div>
          
          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-1 am-text-right" style="margin-top:0.8rem">是否启用</div>
            <div class="am-u-sm-8 am-u-md-4">
            	<div class="am-g">
				  <div class="am-u-sm-2"><label class="am-radio am-secondary"><input type="radio" name="admin.isAccountEnabled" value="true" data-am-ucheck <%if (isAdd || admin.isAccountEnabled == true){%> checked<%}%>> 是</label></div>
				  <div class="am-u-sm-10"><label class="am-radio am-secondary"><input type="radio" name="admin.isAccountEnabled" value="false" data-am-ucheck <%if (admin.isAccountEnabled! == false){%> checked<%}%>> 否</label></div>
				</div>
            </div>
            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${isAccountEnabledMessages!}</div>
          </div>
      </div>
	      <div class="am-tab-panel am-fade" id="tab2">
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">部门</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" name="admin.department" class="am-input-sm" value="${admin.department!}" />
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">&nbsp;</div>
	          </div>
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">姓名</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" name="admin.name" class="am-input-sm" value="${admin.name!}" />
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${usernameMessages!}</div>
	          </div>
	      </div>
    </div>
  </div>
  <div class="am-g am-margin-top">
	  <div class="am-u-sm-12 am-u-md-1 am-text-right admin-form-text"></div>
	  <div class="am-u-sm-12 am-u-md-11">
	  	<button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
	    <button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="window.history.back(); return false;">放弃保存</button>
	  </div>
  </div>
 </form>
</div>
<!-- content end -->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${base}/template/assets/js/amazeui.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<![endif]-->
</body>
</html>
